package com.gaoy.springdemo.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/calc")
@RestController
public class CalcController {
    @RequestMapping("/sum")
    public String sum(String num1, String num2) {
        if(num1.equals("") || num2.equals("")) {
            return "参数不合法";
        }
        Integer sum = Integer.valueOf(num1) + Integer.valueOf(num2);
        return String.valueOf(sum);
    }
}
